Picture
JBoss 7 is the latest Java EE application server to be released by Red Hat. Version 7 is certified against the Java EE 6 Web Profile and has been developed with productivity and speed in mind – the current version offering significant speed enhancements over previous versions. Not only is AS7 available as a download for developers, it is also an important aspect of Red Hat's OpenShift Platform-as-a-Service (PaaS) offering. JBoss AS 7 Configuration, Deployment and Administration explains how to use all the components that make up the application server covering (as you would expect from the title) configuration, management, deployment and administration. Many of these features are different in AS 7 from previous versions of JBoss AS so this book is in invaluable resource. The book is aimed at administrators, developers and testers, so whatever your role, chances are you will find something useful in the book.

The book starts by showing how to download and install AS7. The procedure here is pretty much the same as for other versions of JBoss, so if you've used it before, you shouldn't experience any problems here. What is different however is the structure of the application server itself and the tools used to interact with it. The first chapter of the book explains how the new server is different from previous releases and begins to explain the basics of the server.
After introducing AS7, the book continues to go further into depth on the configuration side of the server. Configuration of thread pools, logging, datasources and EJB etc. is all covered in depth. Plenty of sample XML and diagrams are used to help with the discussions. The book also includes a chapter on configuring and managing JBoss domains which includes useful reading for those implementing and installing JBoss servers.
One of the main pieces of functionality in an enterprise application is probably handled via the Web Container. The book provides plenty of details on how to configure the JBoss Web Container and includes sample Eclipse based source code showing how to create and deploy a basic web application. Note that the emphasis throughout the book is on how the application server can be configured and maintained and not on how to develop Java EE applications. It is useful, from a developer's perspective, to occasionally see some source code to see the interaction with the server however.
In previous versions of the JBoss Application Server, managing the application server (for example creating datasources or JMS queues) was typically performed via manually editing XML files or via the JMX console. With AS 7, both a comprehensive CLI and Web Console are provided. The book contains extensive details of these together with details of how they can be configured.
For those interested in installing JBoss AS, the next few chapters will be extremely useful. Clustering and load balancing are described in-depth with many details included, for example different caching configuration and integration with Apache HTTP Server using mod_jk.
The final chapter of the book discusses cloud computing and how this relates to JBoss AS 7 in the form of OpenShift Express and OpenShift Flex. The author explains these services and then shows how to deploy and manage a simple Java EE application to the services. Given the nature of cloud computing, I believe these chapters will be essential reading for most developers.
If you're developing Java EE applications using JBoss AS 7, or planning to upgrade to AS 7 sometime soon, then I'd recommend this book. The book is useful to new users of AS 7 as well as to those that have been using the AS since it was first released as version 7 last year. Different sections of the book will appeal to different audiences (administrator, developer, tester etc.), but I think the use you'll get from this book will be invaluable.
Recommended reading for all users of JBoss AS 7
Thanks to Sean at Packt Publishing for sending me a copy of this book to review.
JBoss AS 7 Configuration, Deployment, and Administration by Francesco Marchioni. ISBN 978-1-84951-678-5
Don't forget you can win a free copy of this book by commenting about it on the Forums.
 
Java EE 6 Development
Java EE 6 Development With NetBeans 7 aims to show developers how to write Java EE 6 applications using the latest version of Oracle’s NetBeans IDE - NetBeans 7.  The book focuses on using GlassFish as the application server used for developing applications  One of the most useful aspects of this book is that way that it teaches the reader how to use NetBeans as well as how to develop Java EE 6 applications.  Whenever there are NetBeans features (for example shortcuts) that are pertinent to the development in question, these are explained with the end effect that the reader becomes more productive in NetBeans as well as in Java EE 6.

The book starts with taking an overview of NetBeans 7 showing how to download, install and configure the software.  NetBeans 7 can be downloaded pre-configured to work with GlassFish and Java DB, but instructions are provided on how to install other applications servers (such as JBoss) and Databases (such as HSQL).  Although other Java EE 6 application servers could be used throughout the book, the focus is on Java EE 6 itself rather than on the application server.  I’d therefore recommend using GlassFish first and then re-reading if GlassFish isn’t your preferred application server.
After introducing the reader to EE 6 development using NetBeans, there are several chapters that provide a learning trail for Web Development.  First, JSPs are introduced and a simple application is developed using purely JSPs.  The application is enhanced using servlets and JSTL implementing basic security along the way. For developers new to EE 6 development, these chapters provide a good overview of how Java web development used to be and give an appreciation of the underlying technologies used within web development.  Fortunately web development has moved on from the basic JSP/Servlet model and we now have frameworks such as Java Server Faces and component libraries such as PrimeFaces.  These are described at the end of web development section of the book showing how NetBeans offers first class support for both of these technologies.
What web application would be complete without the use of a database?  Fortunately Java EE 6 provides the Java Persistence API.  NetBeans offers excellent support for managing JPA and this is described in the book.  The author doesn’t go very deep into JPA (after all, there are entire books written about it), but provides enough details to allow developers to start learning and start using the features provided by NetBeans.  Features such as creating entity classes from a RDBMS schema or generating JSF applications from JPA entities are all explained in detail.
In the next section of the book, the author describes how to implement EJBs for implementing business tiers with Session Beans and messaging solutions with Message Driven Beans.  Again, plenty of code samples are provided together with tips on how to effectively use NetBeans.  The new Contexts and Dependency Injection (CDI) framework  is also discussed showing how this can be used to integrate the business and presentation tiers of a Java EE application.
If you need to provide interoperability with non-Java EE based systems, then perhaps you need to look at Web Services.  The final two chapters of the book provide an overview of how developers can use NetBeans to write both SOAP and RESTful web services using JAX-WS and JAX-RS.  Development of web services is one of the areas where the combination of GlassFish and NetBeans provides a superior developer experience to other environments.  The ability to develop and modify web services using simple wizards (or via code if you don’t like wizards) and then easily deploy and test is one of the key advantages of Oracle’s Java EE 6 Development/Deploy environment.  As in the rest of the book, there are plenty of samples and the descriptions are informative and easy to understand.  
Finally, the book contains 2 appendices showing how NetBeans can be used to debug and profile enterprise applications - two features that will probably be used widely by all enterprise developers.
Packt Publishing describe the book as being “aimed at Java developers who wish to develop Java EE applications while taking advantage of NetBeans functionality to automate repetitive tasks and to ease their software development efforts.  Familiarity with NetBeans or Java EE is not assumed.”  I’d agree with that and would recommend the book to any developer starting out with Java EE 6.  Even if NetBeans isn’t your preferred IDE, using it in conjunction with this book will almost certainly allow you to learn and become more productive in Java EE 6.
Recommended reading for anyone wishing to learn NetBeans and Java EE 6.
Java EE 6 Development with NetBeans 7 by David R Heffelfinger, 374 pages, ISBN 978-1-849512-70-1
Thanks to Nicole at Packt Publishing for providing me with a copy of this book to review.
 
Picture
EJB 3.1 Cookbook is aimed at Java EE and EJB developers who need a reference guide that addresses the challenges provided by EJB3.1 in the form of “how-to” sections.  At just over 400 pages, the book provides many recipes that will be of benefit to the majority of developers using EJB technologies.

The book is broken down into 12 chapters which form a natural progression starting with simpler recipes through to more advanced EJB techniques.  Each chapter in the book starts off with an introduction detailing the subjects to be described in the rest of the chapter followed by the recipes themselves.  Each recipe follows a standard “pattern”, starting with a title (e.g. “Handling a map-based message”) and a description of what the recipe is trying to achieve.  Recipes are then broken down into sections:
  • Getting ready” provides an overview of how the recipe works.
  • How to do it...” provides a full description of how to achieve the recipe’s objectives.
  • How it works...” explains how any code samples are pulled together and explains any code referenced in the previous section.
  • See also” identifies any other recipes that may include pertinent information to assist the reader in their understanding.
The first three chapters of the book provide an overview of EJBs.  Details are given of Stateless, Stateful, Singleton and Message driven beans.  Details of how to access these types of beans from every useful scenario are given, e,g, via dependency injection, JNDI or from an applet.  After showing how to access EJBs, recipes are provided for controlling beans via such things as concurrency, initialization and granularity.  For MDBs, recipes are provided for receiving different message types such as Map based messages or Object based messages.
After introducing and showing how to reference and use EJBs, the next few chapters of the book describe EJB persistence.  In this section over 30 recipes show how to manage EJB persistence, validation, querying and transactions. These chapters assume that the user has some knowledge of database persistence, but nevertheless provide useful persistence recipes, for example, “Validating persistent fields and properties” or “Handling errors in a transaction”.
The next 2 chapters detail EJB security and Interceptors. The section on security provides details on how to setup security for the GlassFish application server which is used in the code samples throughout the book.  Configuring the application server is specific to GlassFish, but the code samples used throughout the book relate to standard EJB 3.1 and are applicable to any application server supporting the EJB 3.1 standard.
The EE Timer service and EE web services (both SOAP and REST) are the final sections of the book that cover recipes relating to developing EJBs.  As in all recipes in the book, these provide a good introduction to the topic at hand and provide extensive code samples of how to solve the particular development problems.
One of the main goals of EJB 3.x was to achieve an easier programming environment and that has certainly been achieved with EJB 3.x’s extensive use of annotations.  Sometimes however, it can be necessary to still use deployment descriptors when deploying EJB applications.  The various uses of deployment descriptors are detailed in the section “Packaging the EJB”.
EJB 3.1 Cookbook is an excellent resource in an EJB developer’s library.  It’s not the sort of book you pick up and read from cover to cover rather a useful resource that you pick up when you think “How do I do xxx in EJB?”.  With over 100 recipes this book is recommended to developers using EJB technologies.
Thanks to Nicole at Packt for providing me with a copy of this book to review.
EJB 3.1 Cookbook by Richard M. Reese, published by Packt Publishing, ISBN 979-1-849682-38-1.
Further details of the book can be found on the Packt website.
 
GlassFish Security by Masoud Kalali provides an in-depth look at Java EE security issues.  The book is broken down into 3 parts:
1.       The Java EE security model
2.       Securing GlassFish and its environment
3.       Securing Java EE applications using OpenDS and Single-Sign-On (SSO).
The first section of the book describes the Java EE security model.  This section starts by assuming the reader has none or very little knowledge of Java EE security and describes the structure of a Java EE application and how security relates to it.  Basic terms such as User, Role, Realm, Principal and Credential are described together with examples of each.  Authentication and authorization are described and shown how these concepts are applied to Java EE applications as both XML configuration and annotations.
When securing an application for use on GlassFish, several different security realms are available for use.  The book covers the GlassFish File, JDBC, LDAP and Certificate realms showing how each of these can be configured (using OpenDS in the case of the LDAP realm).
The first section of the book ends with a sample application summing up all that has been described so far.  The author shows how to develop and secure a sample Java EE application securing both the presentation and business tiers.  The complete code for this application is available online.  This is a good chapter that brings together all that the reader has learned so far into a simple, yet complete secure application.
Typically developers learn to secure their applications, but can sometimes forget to secure the application server and its environment.  The next section of the book shows how to secure the GlassFish environment and the application server itself.  Here, the author shows how to install and secure GlassFish on the OpenSolaris operating system.  Although the majority of the details here are specific to OpenSolaris, the book also goes into details of securing the Java Runtime with different policies which will be appropriate to all operating systems.  Even if you’re not deploying to OpenSolaris, this section gives a good overview of the problems faced when securing the environment.
After securing the GlassFish environment, the author continues to describe how to secure the application server itself.  In a similar fashion to the rest of this section, security is discussed and shown how to be implemented.  There is no source code provided here, instead details of how to use the JMX and client tools to secure the server.
The final section of the book introduces OpenDS, the open source Directory Server and OpenSSO, the open source Single-Sign-On solution.  To me, this is the most interesting section of the book and covers almost half of the book’s content.  If you’re not familiar with OpenDS or OpenSSO, or even directory services or single-sign-on, then this section probably warrants the price of the book by itself.  As with the rest of the book, the author provides a description of the security features being discussed (e.g. implementing SSO on web apps or web services) and provides illustrations and source code explaining the subject in detail.
If you are developing secure Java EE applications then this book is highly recommended.  The book is written for “application designers, developers, and administrators who work with GlassFish and are keen to understand Java EE and GlassFish security.”
GlassFish Security by Masoud Kalali. ISBN: 978-1-847199-38-6
Thanks to Sean at Packt for providing me with a copy of this book for review.
 
Review: Apache MyFaces Trinidad 1.2 – A Practical Guide By David Thomas
Apache MyFaces Trinidad 1.2 by David Thomas introduces the Trinidad framework and shows how it can be used in combination with the Seam Framework to provide a “comprehensive and effective technology for the development of powerful rich-client web applications”.
The book is comprised of 12 chapters. The first 4 chapters primarily provide useful background information whereas the remaining 8 chapters provide lots of source code examples showing how to use Trinidad with Seam.
In the first few chapters, the author introduces Trinidad and explains why it could be used for development of Rich Internet Applications. He describes several reasons for choosing Trinidad such as the wide range of components (“well over 100”), the framework's interoperability and its maturity.
The author also introduces Seam early on in the book, but there is very little discussion about how to configure and get started with Seam. I think that some prior knowledge of Seam would be useful before reading this book.
After discussing Seam, the author continues to introduce Facelets and its templating facilities. Facelets is a JSF view technology that now a standard technology with JSF 2. In the book however, the author concentrates on JSF 1.x. As with the Seam discussions, I would have liked a deeper discussion on Facelets, but as this is not the major subject of the book I can understand why this is not included.
Moving on, the author begins to discuss Trindad in further detail by discussing the most commonly used tags and attributes for the different components and how Trinidad allows Pages to be partially rendered. Partial Page Rendering (PPR) is Trinidad’s AJAX technology that allows only sections of pages to be rendered based upon events such as button clicks within a web page.
The main detailed content (from a code point of view) begins in Chapter 5 where the groundwork for developing Trinidad / Seam applications begins. This chapter details how Seam applications can be built using the SeamGen tool and then imported into Eclipse. The author shows how to modify a standard SeamGen application to use Trinidad instead of RichFaces – RedHat’s competing JSF component framework.
The remainder of the book provides in depth code coverage on how to use different Trinidad components to build web application. The author describes the Trinidad dialog framework, how to build panels, and forms and how to use many different basic Trinidad components, such as text fields, number fields, trees and tables.
Finally, the author provides details on using Trinidad to generate charts and graphs, wizards and popup dialogs – features that are not available with all JSF component libraries.
This book is a good introduction to Apache MyFaces Trinidad 1.2. Packt Publishing describe the book as being written for “Java Developers who are beginners at JSF and experiences web developers who are looking for an introduction into the world of open source JSF technology”. I would agree with this sentiment, but would also recommend prospective readers have at least a basic knowledge of Facelets and Seam before enjoying the book.
Further information about this book can be obtained from Packt Publishing.
 
JBoss RichFaces 3.3 by Demetrio Filocamo is almost 300 pages long and aims to teach developers how to using RichFaces applications rather than just providing a set of API references.
The book is broadly split into 3 sections.
The first section provides an introduction to RichFaces. An overview and history of RichFaces is provided in chapter 1 followed by a discussion on the features available with RichFaces such as AJAX functionality and skinnability. Chapter 2 of the book provides details on how to start using RichFaces within your applications. Initially, explaining how seamgen can be downloaded and installed provides this. Seamgen is a set of build scripts that are provided with JBoss Seam distributions which create ANT scripts to build, test and deploy Seam applications. If you are not using Seam, the next section of this chapter shows how to integrate RichFaces into standard JSF applications.
I found the content informative, but felt that prior knowledge of Seam would be useful in understanding what is being explained. Finally in this section, the author provides details of Eclipse/JBoss Tools, JBoss Developer Studio and IntelliJ Idea showing where to get each piece of software. I found it strange that no mention of NetBeans was provided here. Admittedly, the support for Seam projects is superior in Eclipse to NetBeans, but NetBeans provides solid JSF/RichFaces support for non-Seam projects.
The next section of the book takes the user through developing a fully blown application using RichFaces and Seam. Again, I felt that prior knowledge of Seam would be useful. During this section, the author shows how to build a working “Contact Manager” application. The application is built from scratch using seamgen as the build system. The author explains the structure of seamgen created projects and shows how many different RichFaces components can be used to create a fully functional AJAX web application. With each form that is created for the application, the web code (facelets) is shown together with the corresponding Seam components acting as JSF backing beans. This is by far the biggest section of the book and provides lot of detail on RichFaces. Sections on skinning, internationalization, user registration and displaying data lists are all provided in detail with particular reference to RichFaces. Where relevant, each of these sections shows how AJAX functionality (provided by default by RichFaces) can easily be employed to enhance the users experience.
The final section of the book shows how some of the more advanced features of RichFaces can be used. Chapters 8 and 9 show how RichFaces skins can be customized and how Maven can be used to create new skins using the RichFaces CDK. The final 2 chapters of the book show how new components can be developed with the RichFaces CDK (a star rating component is created) and how some of the more advanced AJAX components (push and pull) can be used within web applications.
Altogether this is a good book on RichFaces, but it does assume that the reader has some knowledge of developing enterprise applications and in particular I feel that prior knowledge of JBoss Seam would be greatly beneficial to reading the book. This book is recommended for web application developers using JBoss RichFaces.
Thanks to Packt Publishing for providing me the copy of this book to review.
 
"Beginning Java™ EE 6 Platform with GlassFish™ 3: From Novice to Professional " by Antonio Goncalves provides 15 chapters concentrating on the most important APIs and features of Java EE 6.  The book is almost 500 pages long and provides a good level of detail and many code samples and UML diagrams for each topic being discussed.
The book starts by introducing Java EE 6.  A brief history of Java EE is provided showing how it has changed from inception through to the latest version of the specification.  A brief description is provided for the major parts of Java EE describing what containers are used for and what APIs are relevant to each container (Web, EJB, Applet and Application Client).  After describing the basic architecture of Java EE 6, the book explains what is different in EE 6 over previous versions giving code samples and details of the new APIs involved.  Finally in the introduction, details are given of the working environment used to develop code samples throughout the book.  This includes Maven, JUnit, Derby DB and GlassFish v3.  I would have liked to see some samples of EE6 applications using NetBeans 6.8, but because this is still under development I can understand why this was not included in the book.
Chapters 2 through 5 of the book cover Java Persistence using JPA.  This section of the book starts by providing an overview of JPA and describing what is new in JPA 2.0.  ORM, queries and JPA lifecycles are all introduced before a full chapter is provided on each subject.  In each of these chapters (Java Persistence, Object-Relational Mapping, Managing Persistent Objects and Callbacks and Listeners), the subject is described in detail with many code samples and UML and database diagrams where appropriate.  The different APIs used for persistence are detailed in depth, for example, @MappedSuperclass is described together with why it should be used.  When discussing querying JPA objects, details are provided on both SQL and JPQL for comparison.  I think this would be useful to developers who are new to JPQL but are familiar with SQL.  The book really assumes little or no knowledge of JPA querying and discusses dynamic queries, named queries and native queries.
The final chapter on persistence covers callbacks and listeners detailing annotations such as @PrePersist, @PostPersist, @PostRemove and @PostLoad.  Again, as is standard thorughout the entire book, valuable UML diagrams are displayed to help explain the section in question along with numerous code samples as both Java code and XML where necessary.
The next section of the book, chapters 6 through 9, covers what many consider to be one of the main aspects of Java EE - Enterprise Java Beans. This section starts by taking a look at EJB - what is it and how has it changed in this latest release of the specification.  For many of the code samples in the book, a CD Book Store type application is developed progressively throughout the book.  This process is continued throughout the chapters about EJB.  The book shows how to write EJBs, how to call them from client code , how to compile and package them with Maven and then how to deploy to GlassFish using the command line asadmin tool.
Stateless, Stateful and Singleton session beans are described along with techniques for invoking EJBs including dependency injection, the timer service and unit testing.  Next, lifecycle events of EJBs are described including details of the different annotation to make this process simpler.  The book introduces lifecycle annotations such as @PostContruct and  @PreDestroy before describing how interceptors can be applied to EJB using the @Interceptors annotation.
The final section on EJB covers transactions and security.  A thorough description of transactions is provided including details on XA and distributed transactions explaining two-phase commit - something that is not always included in Java EE texts.  As expected, both container and bean managed transactions are detailed along with details of the APIs used and reasons as to why one should use the different types of transactions in the EJB container.
The final third of the book covers the technologies usually found in the web container in Java EE applications.  This covers Java Server Faces 2.0, message sending and SOAP and RESTful web services.
The section on web technologies is my favorite part of the book as it covers so much information.  It covers the basics of web page development and includes details on HTML, XHTML, CSS, DOM, JSP, scripting, JSTL, JSF, Facelets and much more.  I would have liked to see more information on Facelets however as I believe templating of components has great benefits, but is quite often missed by programmers in favor of copy and paste web design.  Having said that, there is sufficient information on Facelets to describe what it is and how it should be used.
The final two chapters of the book describe SOAP and RESTful web services.  These technologies are traditionally difficult to understand and develop, however these chapters provide clear details of how to develop against and deploy these technologies against GlassFish.
All in all, this is a very comprehensive book on Java EE 6 and is thoroughly recommended.  The writing style is easy to understand even when complex subjects are being described.  I would recommend this book to anyone that does Java Enterprise development whether they are intending to use EE 6 technologies or not.
Thanks to Twitter, I found out from @alexismp that the latest code for the book is available from Antonio's web site.
 
"OpenCms 7 Development" by Dan Liliedahl is intended for Java developers who wish to extend and customize OpenCms via its Java APIs. The book takes a tutorial approach to customizing OpenCms starting off by describing the blog application that is developed throughout the course of the book.
Content Management is one of the buzz words within the IT industry at the moment. Many different CMS systems are available which can be customized in different ways either via .NET code, Java code or some other programming languages. OpenCms 7 is developed in Java and can be completely customized using its Java and XML apis.The book starts by describing the skills necessary for OpenCms development which range from basic HTML skills through to Java skills and having an in depth knowledge of the programming model behind the OpenCms product. For this book, it is assumed that the reader has basic Java knowledge and some familiariity with OpenCms although not necessarily at the code level. To ensure the reader has sufficient knowledge of OpenCms, a brief introduction to the product is provided including details of the applications architecture and Virtual File system.
After introducing OpenCms and the different levels of development and customization available, chapter 2 of the book describes how to set up an Eclipse based environment for editing JSP code and how WebDAV can be used for editing pages within an OpenCms enviroment. The author describes this in detail including intricacies that a newcomer to the product may not be aware of. The chapter concludes by detailing how to check OpenCms out of the CVS repository and how to build and debug it within Eclipse.
After spending a fair amount of time with introductions, the author moves on to describe OpenCms modules describing what they are and how to create them within the OpemCms Module Management view. A blog entry content type is created for which the full XSD is listed within the book. After creating a content type, the reader is shown how to register this within OpenCms and how to create field mappings between the content type (XML Schema) and the fields within the blog application that are displayed on the page. Different widgets are described (for example the calendar and HTML editor widgets) along with the XML needed to allow them to be displayed on a form. This section contains a lot of XML and isn't for the feint hearted.
The next chapter of the book continues to talk about user interface issues. In it, the author describes how to build templates for an OpenCms site. This section describes how templates are built (including sidebars, headers and footers) providing details of how the OpemCms Java tag library can be used in conjunction with JSTL and JavaBeans showing how templates for different page types can be built up. The author spends a good amount of time on this section providing code samples for each feature described. All of these code samples used throughout the book are also available on the publisher's web site.
What's a web site without search? Well, chapter 5 details the Lucene search engine which is included as part of the OpenCms distribution. A discussion on Lucene and the Luke Visual Indexer tool follows which is very useful for readers not familiar with the product. Again, as is common throughout the rest of the book, both JSP and Java source code is provided throughout the chapter in this instance, whilst describing how to configure search screens and backend search code.
The next few chapters of the book incrementally add new features to the blog application namely, user registration, comment support, RSS feeds and administration support. The tutorial style is continued throughout these chapters with each starting with a description of the topic at hand. The reader is then taken through the stages necessary to develop the features each one including Java and JSP source code.
This is a good book that I'd recommend for developers who are working with OpenCms 7 however I would suggest that readers of the book be familiar with OpenCms before reading it as the concepts can be quite difficult for new users to grasp. Experience of Java web development is required to make full use of this book as is experience of XML. Further details of this book can be obtained from the Publisher's web site.
 
About.com JavaScript guru, Stephen Chapman has awarded Stoyan Stefanov's 'Object-Oriented JavaScript' book 4/5 stars in his latest review.
Describing it as "A book that demonstrates some of what JavaScript can really do", Chapman goes on to herald the book as "a must have for any serious JavaScript programmer."